fun main(){
val cities=listOf("四川","上海","北京","广州")
println(cities[0])
// 判断是否包含
println(cities.contains("四川"))
println(cities.indexOf("新疆"))
val    newCities=cities.toMutableList()
// 添加
newCities.add("深圳")
println(newCities)
// 删除
newCities.remove("四川")
println(newCities)
// 实现遍历 不变/可变 都可以
newCities.forEach{println("城市: $it")}
newCities.forEachIndexed{index,city->println("城市: $city,索引: $index")}
}
